package com.zhu.service.util.handler.config;

import com.google.common.base.Predicates;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableSwagger2
@Configuration

public class Swagger2Config {
    @Bean
    public Docket webApiConfig(){
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("RcalApi")
                .apiInfo(webApiInfo())
                .select()
                .paths(Predicates.and(PathSelectors.any()))
                .build();
    }


    private ApiInfo webApiInfo(){
        return new ApiInfoBuilder().title("网站api文档")
                .description("本文档是网站前端的内容")
                .version("1.0")
                .contact(new Contact("zhu","http:xxxx","3138836095@qq.com"))
                .build();
    }


}
